#include "userdef.h"
void motor_isr(motor_control_t *pmotor);
INTERRUPT(Timer0_Routine, EXTI_VectTimer0)
{
	motor_control_t *pmotor =&motor_control;
  sys_tick++;
	motor_isr(&motor_control);
	encoder_ec11_scan();
}

void systick_init(void)
{
	TIM_Timer0_Config(HAL_State_ON, TIM_TimerMode_16BitAuto, SYS_TICK);
	EXTI_Timer0_SetIntState(HAL_State_ON);
	EXTI_Timer0_SetIntPriority(EXTI_IntPriority_Lowest);
	EXTI_Global_SetIntState(HAL_State_ON);
	TIM_Timer0_SetRunState(HAL_State_ON);	
}